<div class="page-title">
  <h4>函数列表</h4>
  <!--nzi-document-center-->
  <a class="pull-right help-link" nzi-document-center [docTitle]="'函数管理'">
    <i class="anticon anticon-question-circle-o"></i>函数使用指南
  </a>
</div>
<div class="page-header">
  <p style="margin-bottom: 0;">函数是系统调度和运行的基本单元，函数必须从属于某个应用下，通常是由一系列配置和可运行的代码/软件包组成。</p>
</div>
<div class="padding-content area-col-white">
  <div class="table-top">
    <div class="table-operations clearfix ">
      <div class="pull-left">
        <in-acl-source [inGroup]="'headerAction'" [inService]="'fcs'" [inResourceType]="'fcs-function'"
          [inActions]="['CreateFunction']" [inIsLast]="true" #headerAction>
          <in-acl-btn [inActions]="headerAction.resActions" inAction="CreateFunction" inLabel="创建函数" > 
            <button nz-button nzType="primary" class="btn-add" (click)="createFunction()"><i class="fas fa-plus"></i>
              创建函数
            </button>
          </in-acl-btn>
        </in-acl-source>
      </div>
      <div class="pull-right">
        <!-- 搜索 -->
        <nz-select nzPlaceHolder="请选择应用" style="width: 200px;" [(ngModel)]="groupId" (ngModelChange)="groupChange($event)">
          <nz-option *ngFor="let object of applicationList"
                     [nzLabel]="object.displayName" [nzValue]="object.id">
          </nz-option>
        </nz-select>
        <!-- <nz-input-group nzSearch [nzAddOnAfter]="suffixIconButton">
          <input type="text" nz-input placeholder="请输入函数名称" [(ngModel)]="searchValue" (keyup.enter)="searchFunctions()">
        </nz-input-group>
        <ng-template #suffixIconButton>
          <button class="search-btn" nz-button nzSearch (click)="searchFunctions()">
            <i class="anticon anticon-search search-icon"></i>
          </button>
        </ng-template> -->

        <nz-input-group nzSearch [nzSuffix]="suffixIconButton" style="width: 2rem;">
          <input type="text" [(ngModel)]="searchValue" nz-input placeholder="请输入函数名称查询" (keyup.enter)="searchFunctions()">
        </nz-input-group>
        <ng-template #suffixIconButton>
          <i nz-icon class="ant-input-clear-icon" nzTheme="fill" nzType="close-circle" *ngIf="searchValue" (click)="searchValue = '';searchFunctions()"></i>
          <button nz-button nzSearch (click)="searchFunctions()">
            <i class="anticon anticon-search"></i>
          </button>
        </ng-template>

        <button nz-button class="table-top-opt" (click)="refreshFunctionList()" nz-popover [nzContent]="'刷新'"><i
          class="anticon anticon-reload"></i></button>
          <button nz-button class="table-top-opt" (click)="refreshTagList()" nz-popover [nzContent]="'标签搜索'"><i
            class="anticon anticon-tag"></i></button>

      </div>
    </div>
  </div>
  <app-fcs-table #fcsTable [groupId]="groupId" [name]="searchValue" [groups]="applicationList" [regionName]='regionName' [currentRegion]="currentRegion" (voted)="formChildValue($event)" [inActions]="headerAction.resActions"></app-fcs-table>
</div>
